package com.mySampleApplication.client.components.item;

import com.mySampleApplication.client.components.SDataSource;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.grid.ListGridField;

public class SSelectItem {

    public static SelectItem getSelectItemListGrid(boolean bo){
        ListGridField itemField = new ListGridField("name");
        ListGridField unitsField = new ListGridField("loginName");
        ListGridField unitCostField = new ListGridField("age");

        SelectItem item = new SelectItem("selectItem");
        item.setMultiple(bo);
        item.setWidth(240);
        item.setTitle("下拉表格");
        item.setOptionDataSource(SDataSource.getDataSource());
        item.setValueField("loginName");
        item.setDisplayField("name");
        item.setPickListWidth(450);
        item.setPickListFields(itemField, unitsField, unitCostField);
        return item;
    }

    public static SelectItem getSelectItem(boolean bo){
        SelectItem item = new SelectItem();
        item.setMultiple(bo);
        item.setWidth(240);
        item.setTitle("下拉选项");
        item.setOptionDataSource(SDataSource.getDataSource());
        item.setValueField("loginName");
        item.setDisplayField("name");
        return item;
    }
}
